import request from '@/config/axios'
import { AdminUserListResponse, AdminUserCreateParam, AdminUserUpdateParam } from './types'

// 用户信息详情列表
export const adminUserListApi = (params: any) => {
  return request.get<AdminUserListResponse>({ url: '/admin/user/list/more', params })
}

// 新增管理员
export const createAdminUserApi = (data: AdminUserCreateParam) => {
  return request.post({ url: '/admin/user/create', data })
}

// 删除管理员
export const deleteAdminUserApi = (id: string | number) => {
  return request.post({ url: `/admin/user/delete/${id}` })
}

// 编辑管理员
export const updateAdminUserApi = (data: AdminUserUpdateParam) => {
  return request.post({ url: '/admin/user/update', data })
}

// 管理员密码修改
export const changePasswordApi = (data: any) => {
  return request.post({ url: '/admin/user/password', data })
}

// 修改密码初始数据
export const prePasswordApi = () => {
  return request.get({ url: '/admin/user/prePassword' })
}
